package net.oschina.archx.spring.web;

import net.oschina.archx.spring.entity.User;
import net.oschina.archx.spring.model.JsonModel;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * JsonController
 *
 * @author Archx[archx@foxmail.com]
 * @date 2016/2/25 0025
 */
@RestController
@RequestMapping("/json")
public class JsonController {

    @RequestMapping
    public JsonModel index(@RequestBody List<User> users) {
        JsonModel json = new JsonModel();
        json.setMessage("成功");
        json.setResult(users);
        return json;
    }
}
